package com.kis.core.scan.factory;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.remoting.support.RemoteAccessor;

/**
 * Created by wongloong on 16-4-26.
 */
public class LoadBalanceUrlBasedRemoteAccessor extends RemoteAccessor implements InitializingBean {
    private String accessPath;
    private String serverName;

    public LoadBalanceUrlBasedRemoteAccessor() {
    }

    public String getAccessPath() {
        return accessPath;
    }

    public void setAccessPath(String accessPath) {
        this.accessPath = accessPath;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public void afterPropertiesSet() {
        if (this.getServerName() == null && this.getAccessPath() == null) {
            throw new IllegalArgumentException("Property \'serverName or accessPath\' is required");
        }
    }
}
